﻿<%@ Import Namespace="AFI.Speargun.Web.Core" %>

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    资产 - 新建
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        新建</h2>
    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>
    <% using (Html.BeginForm())
       {%>
    <fieldset>
        <legend>资产</legend>
        <p>
            <label for="Appellation">
                名称:</label>
            <%= Html.TextBox("Appellation", null, new { @class = "input-box", @size = 50 })%>
            <%= Html.ValidationMessage("Appellation", "*") %>
        </p>
        <p>
            <label for="Category">
                类别:</label>
            <%= Html.TextBox("CategoryAppellation", null, new { @class = "input-box", @size = 50, @readonly = "readonly" })%>
            <%= Html.Hidden("CategoryId")%>
            <%= Html.ValidationMessage("CategoryId", "*")%>
        </p>
        <p>
            <label for="Department">
                部门:</label>
            <%= Html.TextBox("DepartmentAppellation", null, new { @class = "input-box", @size = 50, @readonly = "readonly" })%>
            <%= Html.Hidden("DepartmentId")%>
            <%= Html.ValidationMessage("Department", "*")%>
        </p>
        <p>
            <label for="Specification">
                规格型号:</label>
            <%= Html.TextArea("Specification", null, new { @class = "input-box", @cols = 50, @rows = 4 })%>
            <%= Html.ValidationMessage("Specification", "*") %>
        </p>
        <p>
            <label for="AcquisitionModeId">
                取得方式:</label>
            <%= Html.DropDownList("AcquisitionModeId", null, new { @class = "input-box" })%>
            <%= Html.ValidationMessage("AcquisitionModeId", "*")%>
        </p>
        <p>
            <label for="AcquisitionDate">
                取得日期:</label>
            <%= Html.TextBox("AcquisitionDate", null, new { @class = "input-box", @size = 20 })%>
            <%= Html.ValidationMessage("AcquisitionDate", "*") %>
        </p>
        <p>
            <label for="PurchasingAgent">
                采购人:</label>
            <%= Html.TextBox("PurchasingAgent", null, new { @class = "input-box", @size = 50 })%>
            <%= Html.ValidationMessage("PurchasingAgent", "*") %>
        </p>
        <p>
            <label for="OriginalValue">
                资产原值:</label>
            <%= Html.TextBox("OriginalValue", null, new { @class = "input-box", @size = 20 })%>
            <%= Html.ValidationMessage("OriginalValue", "*") %>
        </p>
        <p>
            <label for="Remark">
                备注:</label>
            <%= Html.TextArea("Remark", null, new { @class = "input-box", @cols = 50, @rows = 4 })%>
            <%= Html.ValidationMessage("Remark", "*") %>
        </p>
        <p>
            <label for="DepreciationFinanceId">
                财务编号:</label>
            <%= Html.TextBox("DepreciationFinanceId", null, new { @class = "input-box", @size = 50 })%>
            <%= Html.ValidationMessage("DepreciationFinanceId", "*") %>
        </p>
        <p>
            <label for="DepreciationMode">
                折旧模式:</label>
            <%= Html.DropDownList("DepreciationMode", null, new { @class = "input-box" }) %>
            <%= Html.ValidationMessage("DepreciationMode", "*") %>
        </p>
        <p>
            <label for="DepreciationLife">
                折旧年限(单位：月):</label>
            <%= Html.TextBox("DepreciationLife", null, new { @class = "input-box", @size = 20 })%>
            <%= Html.ValidationMessage("DepreciationLife", "*") %>
        </p>
        <p>
            <label for="DepreciationSalvageValueRate">
                净残值率:</label>
            <%= Html.TextBox("DepreciationSalvageValueRate", null, new { @class = "input-box", @size = 20 })%>
            <%= Html.ValidationMessage("DepreciationSalvageValueRate", "*") %>
        </p>
        <p>
            <label for="DepreciationInsertDate">
                入账日期:</label>
            <%= Html.TextBox("DepreciationInsertDate", null, new { @class = "input-box", @size = 20 }) %>
            <%= Html.ValidationMessage("DepreciationInsertDate", "*") %>
        </p>
        <p>
            <label for="DepreciationStartDate">
                折旧起始日期:</label>
            <%= Html.TextBox("DepreciationStartDate", null, new { @class = "input-box", @size = 20 }) %>
            <%= Html.ValidationMessage("DepreciationStartDate", "*") %>
        </p>
        <p>
            <label for="DepreciationCurrencyId">
                货币类型:</label>
            <%= Html.DropDownList("DepreciationCurrencyId", null, new { @class = "input-box" })%>
            <%= Html.ValidationMessage("DepreciationCurrencyId", "*")%>
        </p>
        <input type="submit" value="下一步" />
    </fieldset>
    <% } %>

    <script type="text/javascript">
        $(document).ready(function() {
            $.ui.dialog.defaults.bgiframe = true;
            $("#dialogCategorySelect").dialog().dialog("close");
            $("#dialogDepartmentSelect").dialog().dialog("close");

            $("#CategoryAppellation").click(function() {
                $("#dialogCategorySelect").dialog().dialog("open");
            });

            $("#DepartmentAppellation").click(function() {
                $("#dialogDepartmentSelect").dialog().dialog("open");
            });

            $("#AcquisitionDate").datepicker();
            $("#DepreciationInsertDate").datepicker();
            $("#DepreciationStartDate").datepicker();
        });
	</script>

    <div id="dialogCategorySelect" title="Category">
        <%
            JQueryTreeView jQueryTreeViewCategory = new JQueryTreeView();
            jQueryTreeViewCategory.TreeId = Guid.NewGuid();
            jQueryTreeViewCategory.TreeController = "Category";
            jQueryTreeViewCategory.Rules = JQueryTreeViewRule.None;
            Html.RenderPartial("JQueryTreeView", jQueryTreeViewCategory);
        %>

        <script type="text/javascript">
        function selectCallback_<%=jQueryTreeViewCategory.TreeId.ToString("N") %>(NODE, TREE_OBJ) {
            $("#CategoryAppellation").val($(NODE).children("a").text());
            $("#CategoryId").val($(NODE).attr("id"));
            $("#dialogCategorySelect").dialog().dialog("close");
        }
        </script>

    </div>
    <div id="dialogDepartmentSelect" title="Department">
        <%
            JQueryTreeView jQueryTreeViewDepartment = new JQueryTreeView();
            jQueryTreeViewDepartment.TreeId = Guid.NewGuid();
            jQueryTreeViewDepartment.TreeController = "Department";
            jQueryTreeViewDepartment.Rules = JQueryTreeViewRule.None;
            Html.RenderPartial("JQueryTreeView", jQueryTreeViewDepartment);
        %>

        <script type="text/javascript">
        function selectCallback_<%=jQueryTreeViewDepartment.TreeId.ToString("N") %>(NODE, TREE_OBJ) {
            $("#DepartmentAppellation").val($(NODE).children("a").text());
            $("#DepartmentId").val($(NODE).attr("id"));
            $("#dialogDepartmentSelect").dialog().dialog("close");
        }
        </script>

    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
</asp:Content>
